import Taro, { Component, request, showLoading, redirectTo } from '@tarojs/taro'
import { View, Button, Text, Image,ScrollView,Swiper, SwiperItem,  } from '@tarojs/components'
import { connect } from '@tarojs/redux'
import { add, minus, asyncAdd, ooo,re} from '../../actions/counter'
import { imgUrl } from '../../config'

import './qzXq.scss'

@connect(({ counter }) => ({
  counter
}), (dispatch) => ({
  add () {
    dispatch(add())
  },
  dec () {
    dispatch(minus())
  },
  asyncAdd () {
    dispatch(asyncAdd())
  },
  haha () {
    dispatch(ooo(0))
  },
  // re(){
  //   dispatch(re())
  // }
}))


class QzXq extends Component {

  // config = {
  //   navigationBarTitleText: '首页'
  // }
  constructor (props) {
    super(props)
    this.state = { 
        value:"<"
     }
  }

  componentWillMount(){
  }
  componentDidMount(){

  }
  back(){
    redirectTo({
      url: '/pages/index/index'
    })
  }
  goCy(){
    redirectTo({
      url: '/pages/cyList/cyList'
    })
  }
  gaQzzl(){
    redirectTo({
      url: '/pages/qzZl/qzZl'
    })
  }
  render () {
    return (
            <View className='index'>
              <View className='head'>
                <Text className='close' onClick={this.back}>{this.state.value}</Text>
                <Text className='name'>圈子</Text>
              </View>
              <View className='top'>
                <View className='touPic' onClick={this.gaQzzl}>
                  <Image src={`${imgUrl}/qzTou.png`} className='tou' />
                  <View className='adress'>
                    <Image src={`${imgUrl}/adressB.png`} className='adressPic' />
                    <Text>重庆</Text>
                  </View>
                </View>
                <View className='right'>
                  <View className='name'>
                    <View className='qzName'>熊猫吃锤子</View>
                    <View className='qd'>签到</View>
                  </View>
                  <View className='qz'>
                    <Text>圈主：熊猫</Text>
                    <Text className='tz'>帖子：216</Text>
                  </View>
                  <View className='like'>喜欢动漫的小伙伴欢迎加入我们，随时随地聊聊聊....</View>
                </View>
              </View>
              <View className='cy'>
                <Image src={`${imgUrl}/qzTou.png`} />
                <Image src={`${imgUrl}/qzTou.png`} />
                <Image src={`${imgUrl}/qzTou.png`} />
                <Image src={`${imgUrl}/qzTou.png`} />
                <Image src={`${imgUrl}/qzTou.png`} />
                <View onClick={this.goCy}>
                  <Text className='name'>成员</Text>
                  <Text className='num'>(100)</Text>
                  <Text className='go'>></Text>
                </View>
              </View>
              <View className='nav'>
                <View>最新回复</View>
                <View>最新发布</View>
                <View className='active'>精华</View>
              </View>
              <View className='zd'>
                <View className='left'>置顶</View>
                <View className='right'>【出欧聚会】全员参加活动，场面非常的热闹热闹热闹热闹了热</View>
              </View>
              <View className='zd'>
                <View className='left'>置顶</View>
                <View className='right'>【出欧聚会】全员参加活动，场面非常的热闹热闹热闹热闹了热</View>
              </View>
              <View className='contAll'>
              {this.props.counter.list.map((item,index) =>
                <View className='cont' key={index} onClick={this.cont}>
                <Image src={item.pic} className='pic1' />
                <Image src={item.jh ? item.jh : ''} className='jh' />
                <View className='text'>
                  <Text className='text1'>{item.tit1}</Text>
                  <Text className='text2'>{item.tit2}</Text>
                  <View className='tou'>
                    <Image src={item.tou} className='touPic' />
                    <Text className='name'>{item.name}</Text>
                    <Image src={item.zan} className='zan' />
                    <Text className='shu'>{item.shu}</Text>
                  </View>
                </View>
              </View>         
              )}
            </View>
            <Image src={`${imgUrl}/fbht.png`} onClick={this.photo} className='fbht'/>
            </View>
      // </ScrollView>

    )
  }
}

